<%
	def tableDefine=tableModel.tableDefine;
    def columns=tableDefine.columns;
	Set excludes=["createdBy", "updatedBy", "createdTime", "updatedTime", "deleted"];
%>
package ${config.basePackage}${config.category};
import lombok.Data;
import com.znv.common.validator.group.AddGroup;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * ${tableDefine.cnname} 新增DTO类
 *
 * @author ${config.author}
 * @date ${config.nowDate}
 */
@Data
public class ${tableDefine.id}AddDTO implements Serializable{
	private static final long serialVersionUID = ${PubUtils.getRandomLong()}L;
<%
	columns.each{
		if(it==null || tableModel.isNotInList('addList',it.columnName)){
			return ;
		}
		if(!excludes.contains(it.getDataName())) {
			if(!it.getCanBeNull()) {
				if(tableNameUtil.getDataType(it.getColumnType()) == "String"){
					println """	@NotBlank(message = "${it.cnname}不能为空", groups = AddGroup.class)""";
				}else {
					println """	@NotNull(message = "${it.cnname}不能为空", groups = AddGroup.class)""";
				}
			}
			println """	@ApiModelProperty(value = "${it.cnname}")""";
			println """	private ${tableNameUtil.getDataType(it.columnType)} ${it.dataName};""";
		}
	};
%>
}